package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.pojo.vo.*;
import org.apache.ibatis.annotations.*;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

@Mapper
public interface WeiboMapper {
//    @Insert("INSERT INTO weibo(content,created,user_id) VALUES(#{content},#{date},#{userId})")
    void insert(Weibo weibo);
//    @Delete("DELETE FROM weibo WHERE id=#{wid}")
    int delete(Long wid);
//    @Update("UPDATE weibo SET content=#{content},created=#{date},user_id=#{userId} WHERE id=#{id}" )
    int update(Weibo weibo);

//    @Select("SELECT id,content,user_id userId,created date FROM weibo WHERE id=#{vid}")
    Weibo select(Long vid);
//    @Select("SELECT content,created FROM weibo WHERE id=#{wid}")
    WeiboVo1 selectVo1(Long wid);
//    @Select("SELECT id wid,content FROM weibo WHERE user_id=#{userId}")
    List<WeiboVo2> selectWeiboVo2UserId(Long userId);

    int deleteWeibo1UserId(Integer[] ids);
    int deleteWeibo1UserId2(List<Integer> ids);


    int dynamicUpdateWeiBoId(Weibo weibo);

    int numberOfWeiBo();

    ResultMapVo1 selectMap1(Long wid);
    ResultMapVo2 selectMap2(Long uid);
//查询指定微博的所有评论信息：微博ID、微博内容、List<Comment>；
    ResultMapVo3 selectMap3(Long cid);



}
